<script setup>
import layout from "@/layout/index.vue";
import { ref, onMounted, onUnmounted, onUpdated, onBeforeMount } from "vue";
const isloading = ref(true);
const percentage = ref(0);
onBeforeMount(() => {
  setTimeout(() => {
    percentage.value = 100;
    setTimeout(() => {
      isloading.value = false;
    }, 500);
  }, 1200);
});
</script>

<template>
  <!-- <layout /> -->
  <router-view></router-view>
  <!-- <router-view></router-view> -->
  <div v-if="isloading" class="loadings">
    <div class="loading-content">
      <div class="loading-text">加载中...</div>
      <div style="width: 500px">
        <el-progress
          :text-inside="true"
          :stroke-width="26"
          :percentage="percentage"
        />
      </div>
    </div>
  </div>
</template>

<style scoped langs="scss">
.loadings {
  width: 100vw;
  height: 100vh;
  background: #fff;
  opacity: 0.8;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  .loading-text {
    font-size: 24px;
    color: #333;
    margin-top: 20px;
  }
  .loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 600px;
  }
}
</style>
